package com.k.kpp.quartz;

import org.quartz.*;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Quartz 原始的最简单的一个job
 * @author LJW
 */
public class JobOne implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        long tid = Thread.currentThread().getId();
        Date date = new Date();
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

        JobDetail jobDetail = context.getJobDetail();
        JobKey key = jobDetail.getKey();
        System.out.println(sf.format(date)+"JobDetail's name and group are "+key.getName()+":"+key.getGroup());

    }
}